home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / CHIPCD_02_2002.iso / Internet / Macromedia ColdFusion Server 5 / coldfusion-50-win-us.exe / data1.cab / Examples / CFDOCS / snippets / gettickcount.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  676 b   |  26 lines

  1. <!--- This example calls the GetTickCount
  2.       function to track execution time --->
  3. <html>
  4. <head>
  5. <title>GetTickCount function</title>
  6. </head>
  7.  
  8. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  9. <BODY  bgcolor="#FFFFD5">
  10. <h3>GetTickCount function</h3>
  11. <!--- Setup timing test --->
  12. <CFSET iterationCount = 1000>
  13.  
  14. <!--- Time an empty loop with this many iterations --->
  15. <CFSET tickBegin = GetTickCount()>
  16. <CFLOOP Index=i From=1 To=#iterationCount#></CFLOOP>
  17. <CFSET tickEnd = GetTickCount()>
  18. <CFSET loopTime = tickEnd - tickBegin>
  19.  
  20. <!--- Report --->
  21. <p>
  22. <CFOUTPUT>Loop time (#iterationCount# iterations) was: #loopTime# milliseconds</CFOUTPUT>
  23.  
  24. </body>
  25. </html>
  26.